
#include <src/test/algorithm/1DSolvers/dichotomy_test.h>
void dichotomy_test()
{
	std::cout << std::endl << "----start find_zero_example---------------------" << std::endl ;
	typedef find_zero_example<OSInterval> fexample;

	std::list<OSInterval> r = find_zeros(fexample::test_trap(), OSInterval(-10, 10));
	std::cout << "\n Zero points of (x-1.)*(x-2.)*(x-3.)*(x-4.). Classical definition \n" << r;
	r = find_zeros(fexample::test_trap1(), OSInterval(-10, 10));
	std::cout << "\n Zero points of 24. -50.*x + 35.*x*x -10.*x*x*x +x*x*x*x. Classical definition \n" << r;

	r = find_zeros(fexample::test_func1d(), OSInterval(-10, 10));
	std::cout << "\n Zero points of sin(x)/(x*x+1)\n" << r;
	r = find_zeros(fexample::test_func1d_2(), OSInterval(-5, 6) );
	std::cout << "\n Zero points of sqrt(x*x-1)\n" << r;



	typedef interval<double> I1_aux;
	typedef unprotect<I1_aux>::type I1;
	typedef find_zero_example<I1> fexample2;


	fexample2::test_polynomial_algebra test_pol;
	std::cout << "\n Zero points of (x-1)*(x-2)*(x-3)*(x-4) using polynomial algebra class \n";
	std::cout << "\n canonical base of (x-1)*(x-2)*(x-3)*(x-4) : \n" << test_pol;
	std::list<I1> ri1 = find_zeros(test_pol, I1(-10, 10));
	std::cout << "\n Zero points of (x-1)*(x-2)*(x-3)*(x-4) using polynomial algebra class \n" << ri1;

	std::cout << std::endl << "----end find_zero_example---------------------" ;
	std::cout << std::endl << "------------------------------------------------" << std::endl;

};
